using System;
using System.Collections.Generic;
using System.Text;
using Xfinity.AI;
using Xfinity.Engine.Plugins;
using Microsoft.Xna.Framework;
using Xfinity.ParticleSystems;
using Microsoft.Xna.Framework.Graphics;

namespace Xfinity.Engine.GameStates
{
    public class GamePlayGameState : GameState
    {
        public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            //GameManager.PlayerManager.Player.Update(gameTime);
            //foreach (IUpdateable component in GameManager.EngineManagedComponents)
            //{
            //    component.Update(gameTime);
            //}
            foreach (Agent a in GameManager.AIManager.Agents)
            {
                if (a.Enabled)
                {
                    a.Update(gameTime);
                }
            }
            
            foreach (ParticleSystem p in GameManager.Level.ParticleSystems)
            {
                if (p.Enabled)
                {
                    p.Update(gameTime);
                }
            }
        }

        public override void Draw(Microsoft.Xna.Framework.GameTime gameTime)
        {
            GraphicsHelper.GraphicsDevice.Clear(Color.Black);
            foreach (Agent a in GameManager.AIManager.Agents)
            {
                if (a.Visible)
                {
                    a.Draw(gameTime);
                }

            }
            foreach (ParticleSystems.ParticleSystem p in GameManager.Level.ParticleSystems)
            {
                if (p.Visible)
                {
                    p.Draw(gameTime);
                }
            }
        }
    }
}